﻿
using System.Data;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;


public class BLL_tbl_raw_material_order
{
    public BLL_tbl_raw_material_order()
    {

    }

    public List<tbl_raw_material_order> select(int RAW_ORDER_ID)
    {
        DAL_tbl_raw_material_order dal = new DAL_tbl_raw_material_order();
        return dal.select(RAW_ORDER_ID);
    }

    public List<tbl_raw_material_order> selectAll()
    {
        DAL_tbl_raw_material_order dal = new DAL_tbl_raw_material_order();
        return dal.selectAll();
    }

    public DataTable selectAllForGrid()
    {
        DAL_tbl_raw_material_order dal = new DAL_tbl_raw_material_order();
        return dal.selectAllForGrid();
    }

    public bool insert(tbl_raw_material_order tbl)
    {
        DAL_tbl_raw_material_order dal = new DAL_tbl_raw_material_order();
        int i = 0;
        i = dal.insert(
            tbl.RM_ORDER_NUMBER
, tbl.USER_CODE
, tbl.CERTIFICATION_FILE
, tbl.CERTIFICATION_FILE_ORIGINAL_NAME
, tbl.Price
, tbl.QUANTITY
, tbl.CURRENCY_ID
, tbl.CERTIFICATION_DATE
, tbl.ETD
, tbl.ETA
, tbl.ETS
, tbl.VESSEL_ID
, tbl.ShippingDetails
, tbl.IS_ACTIVE
, tbl.CREATED_BY
, tbl.CREATED_DATE
, tbl.PaymentTerms
, tbl.ShippingTerms
        );

        return Convert.ToBoolean(i);
    }


    public bool update(tbl_raw_material_order tbl)
    {
        DAL_tbl_raw_material_order dal = new DAL_tbl_raw_material_order();
        int i = 0;
        i = dal.update(
            tbl.RAW_ORDER_ID
, tbl.RM_ORDER_NUMBER
, tbl.USER_CODE
, tbl.CERTIFICATION_FILE
, tbl.CERTIFICATION_FILE_ORIGINAL_NAME
, tbl.Price
, tbl.QUANTITY
, tbl.CURRENCY_ID
, tbl.CERTIFICATION_DATE
, tbl.ETD
, tbl.ETA
, tbl.ETS
, tbl.VESSEL_ID
, tbl.ShippingDetails
, tbl.IS_ACTIVE
, tbl.UPDATED_BY
, tbl.UPDATED_DATE
, tbl.PaymentTerms
, tbl.ShippingTerms
            );

        return Convert.ToBoolean(i);
    }


    public bool delete(tbl_raw_material_order tbl)
    {
        DAL_tbl_raw_material_order dal = new DAL_tbl_raw_material_order();
        int i = 0;
        i = dal.delete(
                tbl.RAW_ORDER_ID
        );

        return Convert.ToBoolean(i);
    }

    public DataTable fetchSuppliers()
    { 
         DAL_tbl_raw_material dal = new DAL_tbl_raw_material();
         return dal.fetchSuppliers();
    }

    public DataTable getQtyForRMOrder()
    {
        DAL_tbl_raw_material_order dal = new DAL_tbl_raw_material_order();
        return dal.getQtyForRMOrder();
    }
}

